home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr11 / mcd_june.zip / OCR.TXT < prev    next >
Text File  |  1993-07-01  |  11KB  |  183 lines

  1. From the June Mastering CorelDRAW newsletter
  2.  
  3.  
  4. OCR Comes to CorelDRAW 4
  5.  
  6. Rich Zaleski
  7.  
  8. With the arrival of version 4, CorelDRAW has made a serious move into the 
  9. page layout arena. With 4's enhancements to Draw's bulk text handling and 
  10. formatting capabilities, it's only natural that the program's link to scanned-in 
  11. images should evolve from a tool that just converts bitmaps to editable vector 
  12. files, to one that can also turn scanned bitmap æpictures of textÆ into editable text.
  13. This is done via the new incorporation of Optical Character Recognition (OCR) 
  14. functionality into the CorelTRACE program. Trace's implementation of OCR may 
  15. not be on the level of dedicated OCR programs, but it is functional and has some 
  16. useful features that you might not expect to find in an add-on to what many 
  17. perceive as merely an add-on utility itself. In fact, it does a remarkable job of 
  18. handling this complex task, especially when you consider that many top-of-the-
  19. line, standalone OCR packages sell for more than the entire Draw 4 suite of 
  20. applications.
  21. Users with heavy OCR requirements will still find it advantageous to invest in a 
  22. more robust, dedicated OCR application. But those with occasional or limited 
  23. need to convert a scanned page of text or incoming fax into editable text, for use 
  24. in either Draw, a word processor or simply to save as a simple ASCII text file, 
  25. should find Trace's OCR capabilities adequate for their needs.
  26.  
  27. The OCR Advantage
  28. Uncompressed, a full-page, 1 bit (black-and-white) bitmap in Windows .BMP file 
  29. format will occupy the better part of 500 Kb of precious hard disk space. That 
  30. same file can be stored in compressed TIFF format, which will cut the file size 
  31. down to just over 100 Kb, if the page isn't too tightly packed with text. However, if 
  32. like so many users today you're using disk compression software, much of the 
  33. advantage usually gained in compressing graphics files is lost, because Stacker, 
  34. DoubleSpace or whatever compression scheme is being used can't squeeze the 
  35. file much tighter -- it occupies nearly the original amount of real hard disk space. 
  36. Compare such bulky file sizes to the 2 or 3 Kb that the same page of text will 
  37. occupy when converted to ASCII text format, and the advantage to æOCR-ingÆ 
  38. any faxes or scanned-in text files that you need to keep on hand is soon evident. 
  39. And, of course, they become editable at the same time.
  40. If you use a scanner, happily the huge bitmap created when scanning pages of 
  41. text need not ever be stored on your hard disk. Simply make use of Trace's 
  42. TWAIN interface to scan in the image directly, by choosing Acquire Image from 
  43. the File menu, then clicking on Acquire. Use Object Linking and Embedding to 
  44. æOLE itÆ into PhotoPAINT for cleaning up or deskewing, if necessary, by choosing 
  45. Edit Image from the Edit menu. Then in Trace select the area of the page that 
  46. you want to convert to text by clicking and dragging a marquee, then click on the 
  47. OCR icon.
  48.  
  49. Memory Considerations
  50. You should keep in mind that OCR is a memory-intensive task. For example, a 
  51. full page of text requires over 10 megabytes of memory to process. Even if 
  52. you've got plenty of available RAM, you may find it necessary to either maintain 
  53. a very large permanent swap file, avoid using Trace's OCR function while other 
  54. tasks run in the background, or both. I've choked Trace with a full page of small 
  55. type, on a 16 Mb system using a 4 Mb swap file. In this case, shutting down 
  56. other applications allowed the job to proceed to completion. If you're relying on a 
  57. swap file to provide the needed memory, you have to be willing to accept the 
  58. performance degradation that comes with virtual memory usage. (Adjust the size 
  59. of your swap file by double-clicking on the 386 Enhanced icon in the Windows 
  60. Control Panel.)
  61. A solution to the possibility of not being able to have any other memory- 
  62. intensive apps running while you perform an OCR operation is to set up all the 
  63. bitmaps on which you need to perform the recognition as a batch trace. Then 
  64. start the batch process just before leaving the office for the day, when no other 
  65. apps will be running. In any case, you should click on Modify in the Settings 
  66. menu, then click on Batch Output, since itÆs here that you set the default output 
  67. directory and the file overwrite/make read only options for all of Trace's output.
  68. Trace provides some controls to work with scanned text files of varying quality. 
  69. Choose OCR Method by clicking on Modify in the Settings menu. The default is 
  70. designed for 300 dpi bitmaps scanned from hard copy of at least laser printer 
  71. quality. Settings for dot matrix and fine-quality faxes (200 by 100 dpi) can also be 
  72. selected. These settings are sticky, and will remain active until you change them 
  73. or select Default from the main Settings menu. How much of a difference do 
  74. these settings make? On a one-page test file generated via fax, tracing it in the 
  75. Normal, rather than Fax, mode produced a text file with 42 errors. With the OCR 
  76. method set to Fax, the same file converted with only a single error.
  77.  
  78. A Few Rough Spots
  79. You'll also notice an option for Check Spelling in this dialog box. In my tests, I 
  80. found this option to be virtually useless. When Draw, or your word processor, 
  81. checks spelling and comes across a combination of letters that it doesn't 
  82. recognize, it offers you the choice of accepting or correcting the spelling error. 
  83. Trace, however, simply ignores the word and doesn't trace it. I'd rather have the 
  84. output file say "The spell chec~er needs some improvement," than leave the 
  85. word out entirely and give me "The spell needs some improvement." At least in 
  86. the latter case the spell checker in my word processor will have something to 
  87. catch. 
  88. This situation is aggravated by the fact that (as far as I've been able to tell) 
  89. Trace's use of the spell checker does not incorporate any user dictionary that 
  90. you might have created. Proper names and specialized terms simply get 
  91. dropped, rather than being flagged by having the rejected letters converted and 
  92. marked with a æ~Æ or some other uncommon character. All in all, I'd strongly 
  93. recommend that you give Trace's Check Spelling option a miss.
  94. Another area where the OCR function could stand some improvement is in the 
  95. area of text formatting. In short, it doesn't. It's not bad with straight paragraphs of 
  96. text, but with columnar data or anything out of the ordinary it just treats each 
  97. string of text as a line followed by a return and linespace. In the end, despite the 
  98. unexpected accuracy of the character recognition, you're still likely to face some 
  99. meaningful editing and reformatting time. Perhaps by the time 5.0 rolls around, 
  100. we'll at least see Rich Text Format (RTF) output with some semblance of 
  101. maintaining the format of the original image. As long as we're wishing, limited 
  102. font identification might be within reach as well.
  103.  
  104. The Forms Approach
  105. Having stumbled across the weakest feature of Trace's OCR function, it's time to 
  106. look at what may be its strongest capability, and is certainly its most intriguing. In 
  107. addition to the standard OCR operation of converting to an ASCII text file, you 
  108. have the option of using the Forms tracing method. This routine first examines 
  109. the bitmap and traces any non-text elements as a graphic in outline and/or 
  110. centerline method, as appropriate. It then OCRs the text, but rather than saving 
  111. it as ASCII, it inserts it into the usual .EPS output file created by Trace as strings 
  112. of Artistic text laid out in the positions appropriate to the image that was traced, 
  113. but in the default font. It seems to want to use a sans serif font by default, since 
  114. depending on which fonts are in the Ares FontMinder Font Packs I have loaded, 
  115. it will be either 12.5-point Avant Garde or Arial. While it's not as fast as straight 
  116. OCR tracing, this feature is particularly handy when tracing logos with 
  117. accompanying text, letterheads, maps and technical illustrations. 
  118. In the accompanying illustrations, I faxed myself a blank invoice and used 
  119. Trace's Forms method to convert it to .EPS. The first trace took it just over three 
  120. minutes on my 33 MHz 486 with 16 MB of memory, and it never required disk-
  121. based virtual memory. Since Trace does not treat white text on a black 
  122. background as text, I then saved the .EPS file, cleared the .EPS window (press 
  123. Delete), inverted the image (choose Modify, then Image Filtering from the 
  124. Settings menu), and marquee selected the areas containing that text. After 
  125. running the Forms trace on these æleftoverÆ text strings, I saved the second .EPS 
  126. file under a different name.
  127. I then imported both .EPS files into Draw and placed them side by side.  After 
  128. ungrouping the .EPS file created with the second scan, I changed the fonts as 
  129. necessary and applied a white fill to them before turning my attention to the 
  130. other copy. I deleted the curves that represented the white text, used the Node 
  131. Edit roll-upÆs Auto-Reduce function on the larger and more complex curves that 
  132. made up the form. I changed all the curve segments in the ætableÆ part of the form 
  133. to lines, and performed minor cleaning up and aligning by snapping the corners 
  134. to the grid. 
  135. Finally, I dragged the white text that remained from the second trace on top of 
  136. the form. Total time from loading the .PCX scan of the form into Trace to printing 
  137. out virtual duplicates of the original from Draw was just over half an hour. Could I 
  138. have drawn and lettered the form from scratch more quickly in Draw? I doubt it.
  139.  
  140. Is it for You?
  141. If you have heavy-duty text conversion needs, you might not ever use Trace's 
  142. OCR capabilities, except for perhaps the occasional need to generate a text-
  143. inclusive .EPS trace of a mixed text and graphic bitmap. But then again, if your 
  144. OCR needs are that intensive, you didn't buy CorelDRAW to fill them. That's why 
  145. Caere and Calera are in business. But for most graphics professionals, who 
  146. don't deal in lengthy text documents, TraceÆs OCR capabilities should fill the bill 
  147. reasonably well.
  148. Those of you interested in trying out TraceÆs OCR capabilities for yourselves can 
  149. use the INV001.PCX file that was placed in the INVOICE directory of this 
  150. monthÆs disk when you installed it. This is the scan of the form I discussed in the 
  151. article.
  152.  
  153.  
  154. TIP
  155. You can also continue an OCR session that halted due to insufficient memory by 
  156. closing the warning dialog box, selecting a smaller area to process, and then 
  157. doing the page in two passes.
  158.  
  159. Contents Copyright Kazak Communications 1993
  160.  
  161.  
  162. Subscription Information
  163.  
  164. While the regular subscription rate is $75 per year (in US dollars for Americans, 
  165. Canadian dollars for Canadians), charter subscriptions to the Mastering 
  166. CorelDRAW newsletter are available for a limited time at $60 (add $30 U.S. for 
  167. overseas). A free sample disk, from our exclusive disk-of-the-month service 
  168. (value $20), is included with your paid subscription. 
  169.  
  170. To subscribe, or for more information, contact:
  171.  
  172. Chris Dickman
  173. 16 Ottawa St.
  174. Toronto, ON M4T 2B6
  175. Canada
  176. 416-924-0759 (voice)
  177. 416-924-4875 (fax)
  178. CServe: 70730,2265
  179.  
  180.  
  181.  
  182.                                                  - 30 -
  183.